package com.jankins.pat;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class PrimerNumber {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while(in.hasNextInt()) {
            int m = in.nextInt();
            int n = in.nextInt();

            bruceForce(m, n);
        }
    }

    public static void bruceForce(int inf, int sup) {
        List<Integer> primers = new ArrayList<>();
        int seq = 0;

        for(int num = 2; num <= Integer.MAX_VALUE ; num++) {
            if(seq >= sup) break;

            if(isPrimer(num) && (++seq >= inf)) {
                primers.add(num);
            }
        }

        // output
        for(int i = 0; i < primers.size(); i++) {
            if(i % 10 == 9) {
                System.out.println(primers.get(i));
            } else {
                System.out.print(primers.get(i) + " ");
            }
        }
    }

    private static boolean isPrimer(int num) {
        for(int factor = 2; factor < num; factor++) {
            if(num % factor == 0) 
                return false;
        }
        return true;
    }
}
